package net.jcip.chapter4;

/**
 * NonReentrantDeadlock
 * <p/>
 * Code that would deadlock if intrinsic locks were not reentrant
 *
 * @author Brian Goetz and Tim Peierls
 */
class Widget {


    public synchronized void doSomething() {

        System.out.println("widget do something ....");

    }
}

class LoggingWidget extends Widget {

    public synchronized void doSomething() {
        System.out.println(toString() + ": calling doSomething");
        super.doSomething();
    }

}
